<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{{ data["name"] }}-飞马测试固件下载中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/third-part/bootstrap-4.1.3/css/bootstrap.min.css">
    <link href="/css/vendor/common.css" rel="stylesheet" type="text/css">
    <link href="/css/vendor/cmp-controls.css" type="text/css" rel="stylesheet">
    <link href="/css/vendor/firmware-center/detail.less" type="text/css" rel="stylesheet/less">
    <script src="/js/less.min.js"></script>
</head>
<body>
    <div class="main">
        <div class="title-wrap" onclick="window.open('/firmware/firmwareCenter')">飞马测试固件下载中心</div>
        <div class="info-wrap">
            <div class="user-download-wrap">
                <div class="user-info">
                    <img class="user-image" src={{ icon }}>
                    <div class="des-wrap">
                        <div class="des">
                            <span class="version">{{ data["version"] }} &nbsp</span><span class="file-name">{{ data["name"] }}</span>
                        </div>
                        <div class="date-wrap">
                            <p class="date">{{ data["created_at"] }}</p>
                            <div id="like" class="like" onclick="clickLike()">{{ data["like_count"] }}</div>
                        </div>
                    </div>
                </div>
                <div class="download-info">
                    {#<div class="like-btn">#}
                        {#<div class="ico"></div>#}
                    {#</div>#}
                    <a class="download-btn" href={{ data["url"] }}>
                        <div class="ico"></div>
                        <p class="des" id="size">下载文件</p>
                    </a>
                </div>
            </div>
            <div class="detail-wrap">
                <?php echo $data["html"] ?>
            </div>
        </div>
    </div>
    <div style="visibility: hidden;">
        <div id="file-size">{{ data["size"] }}</div>
    </div>
</body>
<script src="/js/baidu-statistics.js"></script>
<script src="/js/jquery-3.2.1.min.js"></script>
<script src="/third-part/bootstrap-4.1.3/js/bootstrap.min.js"></script>
<script src="/js/vendor/common.js"></script>
<script src="/js/vendor/cmp-controls.js"></script>
<script>
    var count = 0;
    function clickLike() {
        if (count<=0){
            var value = $("#like").text();
            feimaPost("/firmware/likeFirmware",{
                "id": getQueryString("id")
            }, function (res) {});
            $("#like").text(parseInt(value)+1);
            $("#like").css("background", "no-repeat url(/images/firmware-download/like_4.png) center");
            count += 1;
        }
    }
    $(function(){
        var size = $("#file-size").text();
        console.log(size);
        if (size){
            $("#size").text(fileSizeConversion(size));
        }
    });
</script>
</html>